From: Cosimo Cecchi Date: Tue, 6 Nov 2012 23:42:33 +0000 (-0500) Subject: search: add API to get a list of remote providers X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5418 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=80e7f5832bdd3b77d969d2813c6439e222d1176c;p=gnome-shell.git search: add API to get a list of remote providers This will be used to reload them in case the configuration changes. https://bugzilla.gnome.org/show_bug.cgi?id=687491 --- diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js index 21e3d0f5c..16c09100b 100644 --- a/js/ui/remoteSearch.js +++ b/js/ui/remoteSearch.js @@ -114,7 +114,7 @@ const RemoteSearchProvider = new Lang.Class({ this._proxy = new SearchProviderProxy(Gio.DBus.session, dbusName, dbusPath, Lang.bind(this, this._onProxyConstructed)); - this.parent(appInfo.get_name().toUpperCase(), appInfo); + this.parent(appInfo.get_name().toUpperCase(), appInfo, true); this._cancellable = new Gio.Cancellable(); }, diff --git a/js/ui/search.js b/js/ui/search.js index f106e9160..bc50cb0a4 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -74,10 +74,11 @@ const SearchResultDisplay = new Lang.Class({ const SearchProvider = new Lang.Class({ Name: 'SearchProvider', - _init: function(title, appInfo) { + _init: function(title, appInfo, isRemoteProvider) { this.title = title; this.appInfo = appInfo; this.searchSystem = null; + this.isRemoteProvider = !!isRemoteProvider; }, /** @@ -173,12 +174,16 @@ const SearchSystem = new Lang.Class({ _init: function() { this._providers = []; + this._remoteProviders = []; this.reset(); }, registerProvider: function (provider) { provider.searchSystem = this; this._providers.push(provider); + + if (provider.isRemoteProvider) + this._remoteProviders.push(provider); }, unregisterProvider: function (provider) { @@ -187,12 +192,20 @@ const SearchSystem = new Lang.Class({ return; provider.searchSystem = null; this._providers.splice(index, 1); + + let remoteIndex = this._remoteProviders.indexOf(provider); + if (remoteIndex != -1) + this._remoteProviders.splice(index, 1); }, getProviders: function() { return this._providers; }, + getRemoteProviders: function() { + return this._remoteProviders; + }, + getTerms: function() { return this._previousTerms; },